package kernel_gui.interfaces.kernel_gui;

import common.entities.enums.ACTION;
import common.entities.enums.SEX;
import common.entities.persistent.Actor;
import common.entities.persistent.Movie;

/**
 * @author Yoyo
 *
 */
public interface IManageActor {


	/**
	 * Creates/updates/deletes an actor
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with Boolean value 'true'
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br>
	 * @param actor - the actor to update/delete/create
	 */
	void actionActor(ACTION action,  Actor actor, int requestId);

	
	/**
	 * Counts how many actor records in the DB match wanted query
	 * 
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with Integer value holding number of records
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br>
	 * @param firstNameSubStr - null if not used, a string otherwise
	 * @param lastNameSubStr - null if not used, a string otherwise
	 * @param sex - null if not used, some sex type otherwise
	 * @param movie - null if not used, some movie otherwise
	 */
	void countActors(String firstNameSubStr, String lastNameSubStr, SEX sex, Movie movie, int requestId);
	
	/**
	 * Gets the set of actors from DB that match wanted query ordered by actor first-name and last-name
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with List<Actors> that match wanted query  (no matches is counted as success - empty list)
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br>
	 * @param firstNameSubStr - null if not used, a string otherwise
	 * @param lastNameSubStr - null if not used, a string otherwise
	 * @param sex - null if not used, some sex type otherwise
	 * @param movie - null if not used, some movie otherwise
	 * @param from - starting from 0, 
	 * @param to - not including! (the item at 'to' index);
	 * 
	 */
	void getActors(String firstNameSubStr, String lastNameSubStr, SEX sex, 
			Movie movie, int from, int to, int requestId);
	
	/**
	 * Gets the set of movies from DB that match wanted query ordered by movie title
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with List<Movies> that match wanted query  (no matches is counted as success - empty list)
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br>
	 * @param actor - never null, some actor
	 * @param from - starting from 0, 
	 * @param to - not including! (the item at 'to' index);
	 * 
	 */
	void getActorMovies(Actor actor, int from , int to, int requestId);
	
	/**
	 * Deletes a movie from the movies the actor played in
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with Boolean value 'true'
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br>
	 * @param actor - never null, some actor
	 * @param movie - never null, some movie
	 */
	void deleteMovieFromActor(Actor actor, Movie movie, int requestId);
	
}
